import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/gatewayUser/login',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/user/sys/user/info',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/gatewayUser/sys/logout',
    method: 'post'
  })
}

export function captcha(data) {
  const { uuid } = data
  return request({
    url: '/user/captcha?uuid=' + uuid,
    method: 'get',
    responseType: 'blob'
  })
}

export function userTreeData() {
  return request({
    url: '/user/sys/menu/tree',
    method: 'get'
  })
}
